// function Person() {
// 	this.name = 'Person'
// }

// function* Student() {
// 	console.log(this);
// 	this.name = 'Student'
// }

// let person = new Person()
// console.log(person); //Person { name: 'Person' }
// console.log(person.name); //Person
// let student = Student()
// console.log(student); //Object [Generator] {}
// student.next()
// console.log(student.name); //undefined

// 执行的是遍历器对象，但是生成的对象实例是obj
// function* gen() {
// 	this.name = 'cat'
// }
// let obj = {}
// let g = gen.call(obj)

// console.log(obj instanceof gen); //false
// console.log(g instanceof gen); //true

// console.log(obj); //{name:'cat'}
// console.log(g); //Object [Generator] {}

// g.next()
// console.log(obj.name); //cat
// console.log(g.name); //undefined


function* Animal() {
	console.log('this=', this);
	yield 'hello'
	this.name = 'cat'
	yield this.age = '19'
}
var animal = Animal.call(Animal.prototype);
console.log('animal=', animal);
animal.next()
animal.next()
console.log('name=', animal.name);
console.log('age=', animal.age);
